package cz.boxdesign.library.common.dao;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import cz.boxdesign.library.configuration.AppConfig;

@Ignore
public class CommonObjectDaoText {

  private CommonObjectDao cod;

  @Before
  public void setUp() throws Exception {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
    ctx.scan("cz");
    cod = (CommonObjectDao) ctx.getBean("commonObjectDao");
    assertNotNull("CommonObjectDao is null", cod);
  }

  @Test(expected = DatabaseOperationException.class)
  public void isAccountExpiredTestFailed() throws DatabaseOperationException {
    assertTrue(cod.isAccountExpired(110032));
  }

  @Test
  public void isAccountExpiredTest() throws DatabaseOperationException {
    assertTrue(cod.isAccountExpired(11003));
  }
}
